Everything about The Document Object Model totally explained
The
Document Object Model (
DOM) is a platform- and
language-independent standard
object model for representing
HTML or
XML and related formats.
A
web browser isn't obliged to use DOM in order to render an HTML document. However, the DOM is required by
JavaScript scripts that wish to inspect or modify a web page dynamically. In other words, the Document Object Model is the way JavaScript sees its containing HTML page and browser state.
Because the DOM supports navigation in any direction (for example, parent and previous sibling) and allows for arbitrary modifications, an implementation must at least buffer the document that has been read so far (or some parsed form of it). Hence the DOM is likely to be best suited for applications where the document must be accessed repeatedly or out of sequence order. If the application is strictly sequential and
one-pass, the
SAX model is likely to be faster and use less memory. In addition, non-extractive XML parsing models, such as
VTD-XML, provide a new memory-efficient option.
History
W3C began development of the DOM in the mid-1990s. Although the W3C never produced a specification for DOM 0, it was nonetheless a partially documented model and was included in the specification of HTML 4. By October 1998, the first specification of DOM (DOM 1) was released. DOM 2 was issued in November 2000, with specifics on the style sheet object model and style information manipulation. DOM 3 was released in April 2004 and is the current release of the DOM specification.
Levels
The W3C DOM specifications are divided into levels, each containing required and optional modules. To claim to support a level, an application must implement all the requirements of the claimed level and the levels below it. An application may also support vendor-specific extensions which don't conflict with the W3C standards.
As of 2005, Level 1, Level 2, and some modules of Level 3 are
W3C Recommendations which means they've reached their final form.
Level 0 : The application supports an intermediate DOM, which existed before the creation of DOM Level 1. Examples include the DHTML Object Model or the Netscape intermediate DOM. Level 0 isn't a formal specification published by the W3C but rather a shorthand that refers to what existed before the standardization process.
; Level 1 : Navigation of DOM (HTML and XML) document (tree structure) and content manipulation (includes adding elements). HTML-specific elements are included as well.
Level 2 : XML namespace support, filtered views and events.
; Level 3 : Consists of six different specifications: » # DOM Level 3 Core;
# DOM Level 3 Load and Save; » # DOM Level 3 XPath;
# DOM Level 3 Views and Formatting; » # DOM Level 3 Requirements; and
# DOM Level 3 Validation, which further enhances the DOM
Implementations
Web browsers
Earlier, when each Web browser exclusively supported its own intermediate DOM, interoperability problems were numerous. In order to be
cross-browser compatible, that is, support multiple browsers, large parts of
Dynamic HTML code had to be rewritten for each browser to be supported. A common DOM promised substantial simplification of the development of complex Web applications.
W3C DOM Level 1 has been a recommendation since
1 October 1998. The standardization effort didn't bring forth an immediate change, because non-conformant browsers such as
Internet Explorer 4.x and
Netscape 4.x were still widely used in 2000. By 2005, large parts of W3C DOM were well-supported by common JavaScript-enabled Web browsers, including Microsoft Internet Explorer (version 5 (1999) and version 6 (2001)),
Gecko-based browsers (like
Mozilla,
Firefox and
Camino),
Konqueror,
Opera, and
Safari. Web developers are starting to rely mostly or solely on W3C DOM, since it allows browser compatibility with a large audience .
The article
Comparison of layout engines (DOM) shows which methods and attributes may be used safely given certain browser requirements.
Other
Further Information
Get more info on 'Document Object Model'.
|
External Link Exchanges
Do you know how hard it is to get a link from a large encyclopaedia? Well we're different and will prove it. To get a link from us just add the following HTML to your site on a relevant page:
<a href="http://document_object_model.totallyexplained.com">Document Object Model Totally Explained</a>
Then simply click through this link from your web page. Our crawlers will verify your link, extract the title of your web page and instantly add a link back to it. If you like you can remove the words Totally Explained and embed the link in article text.
As long as your link remains in place, we'll keep our link to you right here. Please play fair - our crawlers are watching. Your site must be closely related to this one's topic. Any kind of spamming, dubious practises or removing the link will result in your link from us being dropped and, potentially, your whole site being banned. |